<script>

    //传统方式定义方法，类似java类
    const person1 = {
        sayHi:function() {
            console.log("Hi")
        },
        sayHello:function(){
            console.log("Hello")
        }
    }

    //调用
    person1.sayHi()
    person1.sayHello()

    //es6:去掉function
    const person2 = {
        sayHi() {
            console.log("Hi")
        },
        sayHello(){
            console.log("Hello")
        }
    }
    person2.sayHello()
    person2.sayHi()
</script>